package com.example.compents;

import com.example.compents.iec.iec104.config.Iec104Config;
import com.example.compents.iec.iec104.server.Iec104MasterFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class senderMaster {

    @Async
    @PostConstruct
    public void sendmassage() throws Exception {
        Iec104Config iec104Config  = new Iec104Config();
        iec104Config.setFrameAmountMax((short) 2);
        iec104Config.setTerminnalAddress((short) 1);
        Iec104MasterFactory.createTcpClientMaster("192.168.1.101", 9997).setDataHandler(new MasterSysDataHandler()).setConfig(iec104Config).run();
        Thread.sleep(1000000);
    }

}
